Fix bug when db has a ' in it