problem with toggling functionality