fixed snapping bug