fix errors and add some ability