hotfix: angular.isObject instead of typeof (null is an object for typeof)