fixing angular logic