Fixed the bug and added script