changed null to random