added deallocation code free_command