bug fixing, code optimization