working version but without clicking directive