fixed bug by checking created_at for nil and setting time to now if it was