converting absolute path to relative to function