fixed a bug with number of tries.