changing weird while true loop