fixed invalid escaping while using postgres