fixed sqlstatements