some bug fixes. worked on test