fixed bugs on first attempt load