fixed alerts in browser
better wifi checking
refactoring