added function for pre call