crud function seems to work fine