fixed a ramdom exception