fix NoMethodError
fix unit tests