fixed up code, have strange error I can't fix