fix bug thanks to apple clang 5.0 for spotting