replaced basename invokes to a variable