You can move this logic to backend