added a new argument (-w )to get data to flask web front end