fixed bugs and prepare for implemented jquery, ajax