Added the helper method to executing commands
bugfixes