append file extension if it not set or incorrect