fixed flickering problem