Check if handle is defined