fixed a bug in blance method