fixed main screen loop