updated lastLogin functionality