Checking if "on_resize" exists before calling it.