fixed type error and changed variable name