fix bug in init which caused callbacks to be called twice
build