modified appcontroller