fixing bug with extension check