Make  basename check simply