fixed horrid bugs