fixed RAND() issue