added return value to thread entry point