Fixed If-Bug