fixes null and random