fixed bug in basename