added 1px threshold to scroll height check