Fixed bugs and enhancement