made edit file query and controller function