Add a file extension check when extracting header file