try long long param cast as gcc 4.8 doesnt like int64_t, long long std::max