bug fixes for profile and add es5 shim