Fixed a bug which caused a crash on IE 7