changed code to remove warnings