Added check to make sure object is initialized