fix a bugs and create test page