Reverted str2bool function back to the original