fixed bug with double delcation of the udate function
modes index