added validation for different commands before submitting the query and placeholder