added a new function to get file extension