[BUGFIX] Fixes a bug when an update query was executed on the wrong table