fixed compilation errors due to removing mutable from lambda