fixed closest method to not explode on document
1.0.2