removed file extension check, insted of, put directly extension into func