controller revised to separate new and edit