fixed potential memory leak, also printing data types out for debug