solved a couple of bugs