Update to query instead prepare