I've fixed the use; regarding the custom type I'm not sure it's needed in that case.