Error handling
Minor for window