add appropriate file extension