Added check with try..except block if group (pk=3) exists. Else use number=0.