Did you replace the chain? Did you put the proper chain on for you cassette? I once had a 9 speed chain on an old 6 speed freewheel and I found that it would ride along the tops of the teeth and not engage unless I had the derailleur perfectly centered.