handling delete and create