fixing issue with angular scope error?