Fix missing reference to zepto
If error is returned replace history state