added feature to clear selection

also when user selects element it is in closed state