refactored update action in the wagers controller