Added more checks in command