fix wrong end() test