Add error checking everywhere to figure out why it's broken