Fixed bug impeding angular to be executed