better free memory check