logic handling properly now