fixed code that caused warnings