fix memory freeze in asnych calls and clear cache in excpetional cases