added NO_GRAPHICS flag for profiling