trying to make it compatible w/ angular 1.3