we might want to migrate this into the functions.js but it should be fine for now.