update code to remove warnings