make maze file loading more robust