fixing some issues found when testing