fix flags offset