using promise for logout