Logging

More error eficiency