added error handling for bad syntax of SP; command