fixed potential memory-leak