adding loginastoby function to index