throw error for incorrect arguments in addListener()