fix stack corruption issue with param filename construction