ensuring that some objects aren't undefined