improve demo and bug fixes