Fixing typecast exception caused by not adherring to the contract of FileExtension