added free memory macro