solved some bug in next