Fixing code to get ready to add ajax code