fix file extension extraction