Catch error in getting screen resolution