added code for user to activate and set active state in table