deleting keys if they're nil