moved checking from controller to object