Javascript and main overriden