Changed to strrchr to get last '.' in file name