fix new file button
remove extraneous functions
fix race condition on opening files