basename fix for script