use realpath to prevent $PATH bug

Change-Id: I22a09e88d6773c652979cd1b5f3e79aa527653c2