fixed the bug reported by Levi