fixed formatting
fixed possible nil panic when item is deleted immediately after being added