edit and delete funcitions fixed