Rectified a very irritating javascript error