fixed more logic