added dev machine host for cors + added check to prevent exception