Added backwards compatibilty
Fixed undefined "data" var