Some changes to the callback
Fixed javascript callback