fix cast, fixed = when == was meant