This commit fixes an issue on the random update function