Fixed avascipt bug