srand should only be used once