fixed code for random player