port handler bugfixes (might need more)