Edited the same code in pages and sections controller from subjects controlller.