replace method provides null when updating a nonexisting object