add registration call and fix a bug in timer
probably mostly done