add specs and fix errors