Fixed exception when non object is passed