fixed problem caused by moving the command execution into a separate