Fix locate function

Try to fix travis test