fixed some problems and routing