added switchcase for different file type