adding directives and fixing main page