fixed bug #1
fixed bug #2