fix bug, but add test