a couple bugs fixed