Fixed so works in production mode