Fixed null pointer exception in handleDelete