Fixed JavaScript selection error