solve run twice problem