Changed code to allow testing on localhost