fix foreach php warning (fixes #11)