Move debug before error is thrown
Move all debug before error is thrown