fixed bug when deleting non existent document in DB caused a NullPointerException