fixes call to non object notice