The else statement was causing the wrong url to be used in production.