Fixed bug when deleting, also using flag instead of actually removing