Resolving basename issue