fixed checking current scroll position of document