Changed code to use from_str method to convert strings to bool