fixed up a couple bugs