Fixed messages with ' breaking sql statements