undefined $id fix