fixed free margin check, magicSet