refactor to check for existence of datetaken as opposed to using catch