Framework upgrade to properly escape strings for db queries