fixed issue with positions not closing