Cleaned up the code
Added popup controller to DetailView