ref #1 bug fixed