fixed bug when id is given but no record exists