added log in functionality, flash notices & alerts