fixed a crash where we weren't checking for nil