fixed generation of random integer from interval