fixed and added spec testing