updated data controller with small fixes