updating code on inital load