Modeling the instability behavior of thin film devices: Fermi Level Pinning