added warnings after code review