Add better logging
Remove big logic error