fixed #1, fixed #2, fixed #3, fixed #4