fix null error while edit controller