Code working excpet for 'delete()'