now I fixed it. Why did I write shitty untested code?