Fixed warning issues by attr method

The attr method that accepts a boolean is obsolete, and prints an annoying warning. I replaced the method call with the equivalent attr_accessor call.