Calling a bool 'ok' makes reading the code confusing. I suggest you rename it to 'isOk' or something along those lines.