logging optimized and added logging for delete action