Fix controller executing twice
- Make the modal work.
- Delete unused code.
- Improve code.