fix canupgrade function for buildings