enhancement and bug fixing