account.active and error handling added