Fix bug and add runtime