added listeners, updated login functionality