fix path and global variable reference