fix bug #2
fix bug #3
fix bug #1