Threw some exceptions and added IP address detection