fixed bug when the freed location is largest mem