typeof conditions fixed