fixed annoying bugs >.<