forgot to encapsulate if and return null for gui close