properly detect the end-of-scroll condition.