fix for random functions