working like-to-insert-to-db and unlike-to-delete-from-db functionality