int is volatile - can be modified in callback