added first check for fling function