- added more logic