fix basename -> dirname