fix basename issue