constructor from file