removed extra var and added global baseprefix