fixed loadMain to call proper init and validated data-main is present
fixed init call on load main