how long does it take to get emergency custody