added method for removing a listener