remove usless if statement from checkpackage functions
remove unused variable localpackageadded