conditional crud working