bug fixes, delete functionality