Added error handling to statement create