changing to js object