added error handling for create query statements
added error handling for create query statements