more nullptr checks