Fixing the file extension check