remove checks before freeing resources

fixes issue discussed in #1763