fix bug with callbacks and add normalization