Fixing potential type error with port