use promises. tried crappy login solution