Added some Exception to check if grammar is correct or not.