Adding handling to panel click