made check for next a little smarter