fix bug preventing remove function from segfaulting when package is not installed