moving to statSync to fix nasty async bug