added exception handler if input is empty or if command is non-existent