Add before function to app