made sure we are putting all table names in ticks
fixed a bug, made sure we trim value strings