adding failing test and fixing bug