removed un needed replace functions in query