modified function  autonotely