more spec and bug fixing