Added not found id error checking