Added data length check to view data controller