fix function to be static to avoid strict warnings