moved boolean method to local variable
moved boolean method to local variable