find and fix 2 bugs