transfered async-handling to $q.defer