better ie support and add onError method