added code to handle the situation when no command is received