bug fixing, improvements