Added EOF handler