not working since angularjs has no async=false