fixed a notice when initializing the object for the first time