updated main for cors