Fixed bug causing angular to crash