building GUI: fixed error when opening another file