Finally fixed angularJS callbacks