fixed an issue with angular controller being called twice