preven screen=undefined error