Add function to set custom type