Fix the pull happening when the top element is not shown

Pull request 234 on chrisbanes repo. Fix pull happening when top element not show.