fixed type error that compiler didnt catch immediately