fixed and updated to new Agda