editing pins controller to address errors