added before_new function, added custom controller functions