couple of bugs fixed