Fix readfile in controller