Fixed the exception when categorize button is clicked more than once in a session.