Fixed receiveCommand (uses BufferedReader)