few changes to preparestatement for performance