added file extension check