fixed 2 bugs