fixed error and tested