Fied a bug which caused wrong codes to crash the webpage.