fix logic error & brackets & rain