better error handling & showing loading indicator