fix check return value of next call