Fixed dropdown javascript errors