routes fixed part1 and global function changes