make the rect selector working