check that the requested handle is not taken

[finishes #77768828]