Fixed Crash because of wrong sql statements (some characters were not
propper escaped)