Added file extension check