added code to remove page flickers