-made dynamic directory creation synchronous, fixes premature access of messages.htm error