Fixed the statments ending to early