fixed no end bug
controller refactoring
Merge pull request #23 from LindsayH/master

fixed no end bug